package com.spring.springtest.service;


import com.spring.springtest.domain.user;
import com.spring.springtest.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    private final UserMapper userMapper;

    @Autowired
    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public List<user> getAllUsers() {
        return userMapper.findAllUsers();
    }
    @Override
    public user findUserById(int id) {
        return userMapper.findUserById(id);
    }
}
